package com.qfmy.model.enums.user;

/**
 * @author 清风明月
 * @Package com.qfmy.model.enums
 * @date 2025/4/13
 * @description 用户的性别
 */
@SuppressWarnings("all")
public enum GenderStatus {
    MALE(0,"男"),
    FEMALE(1,"女");

    private Integer code;
    private String desc;
    GenderStatus(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    /**
     * 根据code获取描述
     */
    public static String getDesc(Integer code) {
        for (GenderStatus genderStatus : GenderStatus.values()) {
            if (genderStatus.getCode().equals(code)) {
                return genderStatus.desc;
            }
        }
        return null;
    }
}
